<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>iframe for 12256</title>
   	<script type="text/javascript">

// Appends a CSS file to a document.
function AppendStyleSheet( documentElement, cssFileUrl )
{
	var e = documentElement.createElement( 'LINK' ) ;
	e.rel	= 'stylesheet' ;
	e.type	= 'text/css' ;
	e.href	= cssFileUrl ;
	documentElement.getElementsByTagName("HEAD")[0].appendChild( e ) ;
	return e ;
}


var FCKPanel = function( parentWindow )
{
	this._Window = parentWindow || window ;

	var oIFrame = this._Window.document.createElement('iframe') ;
	oIFrame.src					= 'javascript:void(0)' ;

	if ( this._Window == window.parent && window.frameElement )
		window.frameElement.parentNode.insertBefore( oIFrame, window.frameElement ) ;
	else
		this._Window.document.body.appendChild( oIFrame ) ;

	var oIFrameWindow = oIFrame.contentWindow ;

	var oDocument = this.Document = oIFrameWindow.document ;

	// Initialize the IFRAME document body.
	oDocument.open() ;
	oDocument.write( '<html><head></head><body>This iframe has been created. It should have green background and an smiley<\/body><\/html>' ) ;
	oDocument.close() ;
}


window.onload = function()
{
	var oPanel = new FCKPanel( window.parent ) ;

	AppendStyleSheet(oPanel.Document, 'styles.css' ) ;

	var eLine = oPanel.Document.body.appendChild( oPanel.Document.createElement( 'IMG' ) ) ;
	eLine.src = 'smiley.gif' ;
}

	</script>
</head>
<body>
this iframe will append an iframe to its parent document.
</body>
</html>
